import axios from 'axios'
import { request ,token} from '@/utils/request';
import cache from '@/utils/cache';
import { request_t,instance} from '@/utils/request2';

//个人中心首页
export function GetUserInedx(id) {
    const url = '/api/user/home/index';
    const data = {
        callback: 'callback'
    };
    let res=request_t(url, 'get', data)
    return res
};

//获取登录用户的信息
export function _getuserInfo(id) {
    const url =  request.baseURL + '/api/user/home/UserInfo';
    const data = {
        id:id,
        callback: 'callback'
    };
    return axios.get(url, {
        params: data
    }).then((res) => {
        return Promise.resolve(res.data);
    });
};

//邀请用户成功后，记录
export function InviteRecord(uid,pid) {
    const url =  request.baseURL + '/api/user/home/InviteRecord';
    const data = {
        uid:uid,
        pid:pid,
        callback: 'callback'
    };
    return axios.get(url, {
        params: data
    }).then((res) => {
        return Promise.resolve(res.data);
    });
};

//个人中心简历
export function GetResume(id) {
    const url = request.baseURL+'/api/user/home/GetResume';
    const data = {
        id:id,
        callback: 'callback'
    };
    return axios.get(url, {
        params: data
    }).then((res) => {
        return Promise.resolve(res.data);
    });
};

//是否为vip
export function GetUserState() {
    const url = '/api/user/home/GetUserState';
    const data = {
        callback: 'callback'
    };
    let res=request_t(url, 'post', data)
    return res;
};

//刷新简历
export function RefreshPreview() {
    const url = '/api/user/home/RefreshPreview';
    const data = {
        callback: 'callback'
    };
    let res=request_t(url, 'post', data)
    return res;
};

//简历公开状态切换
export function SwitchResumeStatu() {
    const url = '/api/user/home/SwitchResumeStatu';
    const data = {
        callback: 'callback'
    };
    let res=request_t(url, 'post', data)
    return res;
};

//获取简历的下载价格 


export function IsPayResume(id) {
    const url = '/api/user/home/IsPayResume';
    const data = {
        expandId:id,
        callback: 'callback'
    };
    let res=request_t(url, 'post', data)
    return res;
};
